package com.example.swagger.model;

import java.util.Date;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;
import lombok.Setter;


@Getter
@Setter
public class Order {

    @JsonProperty("id")
    private Long id;


    @JsonProperty("petId")
    private Long petId;


    @JsonProperty("quantity")
    private Integer quantity;


    @JsonProperty("shipDate")
    private Date shipDate;

    @JsonProperty("status")
    private StatusEnum status;

    @JsonProperty("complete")
    private Boolean complete;

    /**
     * Order Status
     */
    public enum StatusEnum {
        PLACED("placed"),

        APPROVED("approved"),

        DELIVERED("delivered");

        private final String value;

        StatusEnum(String value) {
            this.value = value;
        }

        @JsonCreator
        public static StatusEnum fromValue(String value) {
            for (StatusEnum b : StatusEnum.values()) {
                if (b.value.equals(value)) {
                    return b;
                }
            }
            throw new IllegalArgumentException("Unexpected value '" + value + "'");
        }

        @Override
        @JsonValue
        public String toString() {
            return String.valueOf(value);
        }
    }
}